package com.dingding.manager.common.dao;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.hibernate.criterion.Order;

public class Page<T> implements Serializable {

	private static final long serialVersionUID = -6929262811119383774L;

	private List<T> list = new ArrayList<T>();  // 当前页的显示结果
	private int pageNo = -1; 					// 当前页的页码
	private int pageSize = -1; 					// 结果数量(-1就是不分页)
	private int totalPage; 						// 总页数
	private int totalRow; 						// 总条数
	private Order orderBy; 						// 标准查询有效， 实例：Order.asc("name");
	
	public Page(int pageNo, int pageSize) {
		this.pageNo = pageNo;
		this.pageSize = pageSize;
	}

	public List<T> getList() {
		return list;
	}

	public void setList(List<T> list) {
		this.list = list;
	}

	public int getPageNo() {
		return pageNo;
	}

	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getTotalPage() {
		return totalPage;
	}

	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}

	public int getTotalRow() {
		return totalRow;
	}

	public void setTotalRow(int totalRow) {
		this.totalRow = totalRow;
	}

	public Order getOrderBy() {
		return orderBy;
	}

	public void setOrderBy(Order orderBy) {
		this.orderBy = orderBy;
	}

	@Override
	public String toString() {
		return "Page [list.size=" + list.size() + ", pageNo=" + pageNo + ", pageSize=" + pageSize + ", totalPage=" + totalPage
				+ ", totalRow=" + totalRow + ", orderBy=" + orderBy + "]";
	}
}
